Skip to content

fix: treat at-rule names as case-insensitive across rules #233

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

thecalamiity
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

Ensure at-rule names are treated case-insensitively across rules, aligning with CSS syntax and preventing missed detections when authors use mixed-case at-rules.

What changes did you make? (Give an overview)

  • Updated rule listeners to use case-insensitive matching
  • Added mixed-case variants to tests to verify case-insensitive behavior

Related Issues

Is there anything you'd like reviewers to focus on?

@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Aug 9, 2025
@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Aug 9, 2025
@@ -42,7 +42,7 @@ export default {
const imports = new Set();

return {
"Atrule[name=import]"(node) {
"Atrule[name=/^import$/i]"(node) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also share the official reference where it is mentioned these are case insensitive?

Copy link
Contributor Author

@thecalamiity thecalamiity Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The at-rules affected in this PR are defined across different specs, so I’ll need to track down the relevant references. In the meantime, here’s a StackBlitz reproduction for @import.

@nzakas
Copy link
Member

nzakas commented Aug 11, 2025

CSS at-rules are case sensitive, so closing.

@nzakas nzakas closed this Aug 11, 2025
@github-project-automation github-project-automation bot moved this from Needs Triage to Complete in Triage Aug 11, 2025
@thecalamiity
Copy link
Contributor Author

thecalamiity commented Aug 11, 2025

@nzakas CSS at-rule names are case-insensitive. I tested each at-rule changed in this PR to confirm this before opening it.

Here is a StackBlitz reproduction for @import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

3 participants